﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:omaneui="clr-namespace:OMANE.Common.UI;assembly=OMANE.Common.UI"
                    xmlns:local="clr-namespace:OMANE.Modules.PMT" 
                    x:Class="Ressources" >

 
    
    <DataTemplate DataType="{x:Type local:DefaultTabSection}">
        <RichTextBox />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelPMT}">
        <local:ViewPMT/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelTableEditor}">
        <local:ViewTableEditor />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelTableViewer}">
        <local:ViewTableViewer />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelTableViewerFilter}">
        <local:ViewTableViewerFilter />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelParametrerGroupe}">
        <local:ViewParametrerGroupe />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrerGroupeCRT}">
        <local:ViewParametrerGroupeCRT />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelGererPerimetre}">
        <local:ViewGererPerimetre />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrageAvance}">
        <local:ViewParametrageAvance />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrerGeneration}">
        <local:ViewParametrerGeneration />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrerNouveauGroupe}">
        <local:ViewParametrerNouveauGroupe />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrerNouvelleGeneration}">
        <local:ViewParametrerNouvelleGeneration />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelParametrerReassurance}">
        <local:ViewParametrerReassurance />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelInputBox}">
        <local:ViewInputBox />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type local:ViewModelParametrerTauxComFrais}">
        <local:ViewParametrerTauxComFrais />
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ViewModelParametrerDeroulement}">
        <local:ViewParametrerDeroulement/>
    </DataTemplate>

    <Style  TargetType="Button">
        <Setter Property="Background" Value="White" />
        <Setter Property="Padding" Value="2" />
        
    </Style>
    <Style  TargetType="MenuItem">
        <Setter Property="Background" Value="White" />
    </Style>
    
    <Style TargetType="ComboBox" >
        <Setter Property="Background" Value="White" />
    </Style>
    
    <Style TargetType="ComboBoxItem">
        <Style.Triggers>
            <Trigger Property="ComboBoxItem.IsHighlighted" Value="True" >
                <Setter Property="Background" Value="Black" />
                <Setter Property="Foreground" Value="White" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="TextBox">
        <EventSetter Event="KeyUp" Handler="TextBoxKeyUp" />
    </Style>
    
    <Style TargetType="{x:Type local:AdvancedDatagrid}" >
        <Setter Property="ColumnHeaderStyle">
            <Setter.Value>
                <Style TargetType="DataGridColumnHeader" >
                    <Setter Property="HorizontalAlignment" Value="Stretch" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="Background" Value="White" />
                    <Setter Property="ContentTemplate" >
                        <Setter.Value>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Column="0" Margin="2" VerticalAlignment="Center"   Text="{Binding}" />
                                    <Button Grid.Column="1" Margin="2"   Content=" ... " VerticalAlignment="Center" Background="White" CommandParameter="{Binding}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:AdvancedDatagrid}}, Path=ShowFilterCommand}" >
                                        <Button.Visibility>
                                            <Binding Path="ShowFilterButton" RelativeSource="{RelativeSource AncestorType={x:Type local:AdvancedDatagrid}}">
                                                <Binding.Converter>
                                                    <BooleanToVisibilityConverter />
                                                </Binding.Converter>
                                            </Binding>
                                        </Button.Visibility>
                                    </Button>                               
                                </Grid>
                                <!---->
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
